how to use mean value theorem